package client

import (
	"context"
	"google.golang.org/grpc"
	"weekly2/rpc/proto/user"
)

type Handler func(ctx context.Context, server grpc.ServiceRegistrar) (*user.UserClient, error)

func ServerUserClient(ctx context.Context, handler Handler) (*user.UserClient, error) {
	dial, err := grpc.Dial("127.0.0.1:8080", grpc.WithInsecure())
	if err != nil {
		return nil, err
	}

	defer dial.Close()
}

func Register(ctx context.Context, i *user.LoginReq) (*user.LoginResp, error) {
	ServerUserClient(ctx, i)
}
